<template>
  <div class="userContainer">
    <div class="list">
      <div class="list_title">
        <div>个人设置</div>
        <ul>
          <li :class="{ active: shows == 1 }" @click="set1">
            <router-link to="/info">个人信息</router-link>
          </li>
          <li :class="{ active: shows == 2 }" @click="set2">
            <router-link to="/changepwd">修改密码</router-link>
          </li>
        </ul>
      </div>
      <div class="list_title">
        <div>我是买家</div>
        <ul>
          <!-- <li :class="{ active: shows == 3 }" @click="set3">
            <router-link to="/myorder">我下的订单</router-link>
          </li> -->
          <li :class="{ active: shows == 4 }" @click="set4">
            <router-link to="/address">收货信息</router-link>
          </li>
        </ul>
      </div>
      <div class="list_title">
        <div>我是卖家</div>
        <ul>
          <!-- <li :class="{ active: shows == 5 }" @click="set5">
            <router-link to="/mysellorder">我收到的订单</router-link>
          </li> -->
          <li :class="{ active: shows == 6 }" @click="set6">
            <router-link to="/sellbooks">我的出售</router-link>
          </li>
        </ul>
      </div>
    </div>

    <!-- 右侧 -->
    <div class="info">
      <!-- 路由占位符 -->
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: 'user',
  data() {
    return {
      // 控制选中样式
      shows: 1
    }
  },
  methods: {
    set1() {
      this.shows = 1
    },
    set2() {
      this.shows = 2
    },
    set3() {
      this.shows = 3
    },
    set4() {
      this.shows = 4
    },
    set5() {
      this.shows = 5
    },
    set6() {
      this.shows = 6
    }
  }
}
</script>

<style lang="scss" scoped>
.userContainer {
  width: 980px;
  height: 1000px;
  display: flex;
}
.list {
  width: 280px;
  padding: 10px;
  background-color: #fff;
  .list_title {
    display: block;
    div {
      font-size: 20px;
      margin: 5px 0px;
      font-weight: bold;
      color: #777;
    }
    ul {
      display: block;
      li {
        height: 30px;
        line-height: 30px;
        padding-left: 20px;
        a {
          display: inline-block;
          width: 100%;
          font-size: 16px;
          color: rgb(181, 181, 181);
        }
      }
    }
  }
}
.active {
  border-left: 6px solid rgb(200, 167, 75);
  background-color: #ebebeb;
}
.info {
  width: 670px;
  padding: 10px;
  margin-left: 10px;
  background-color: #fff;
}
</style>
